<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="jsoner.commons.bittools.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>jsoner.commons.bittools.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		JSONER common bit tools.

 JSONER can be downloaded free from
 <a href="http://sourceforge.net/projects/jsontools"> http://sourceforge.net/projects/jsontools </a>.
 Here anyone can leave his comments and wishes.<BR/><BR/>
	
</p>

<hr>



<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/**
 * Copyright (c) 2007, Softamis, http://soft-amis.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author: Alexey Luchkovsky
 * E-mail: soft_elf<span class="attrib">@users</span>.sourceforge.net
 *
 * Version: 1.021
 * Last modified: 05/03/2007
 */</span>

<span class="comment">/**
 * <span class="attrib">@fileoverview</span>
 *
 * JSONER common bit tools.
 *
 * JSONER can be downloaded free from
 * &lt;a href="http://sourceforge.net/projects/jsontools"&gt; http://sourceforge.net/projects/jsontools &lt;/a&gt;.
 * Here anyone can leave his comments and wishes.
 */</span>

<span class="comment">/**
 * Defines common bit tools name space.
 */</span>
COMMONS.BITTOOLS = {};

<span class="comment">/**
 * Tests the specified value by bit mask.
 *
 * <span class="attrib">@param</span> {Integer} The value.
 * <span class="attrib">@param</span> {Integer} The bit mask.
 * <span class="attrib">@return</span> {Boolean} Returns true if the bits "ON" for the given bit mask;
 * otherwise it returns false.
 */</span>
COMMONS.BITTOOLS.checkBit = <span class="reserved">function</span>(aValue, aMask)
{
	<span class="reserved">return</span> (aValue &amp; aMask) === aMask;
};

<span class="comment">/**
 * Sets the bits with specified bit mask and returns the new value.
 * <span class="attrib">@param</span> {Integer} The value.
 * <span class="attrib">@param</span> {Integer} The bit mask.
 *
 * <span class="attrib">@return</span> {Integer} The new value.
 */</span>
COMMONS.BITTOOLS.setBit = <span class="reserved">function</span>(aValue, aMask)
{
	<span class="reserved">return</span> aValue | aMask;
};

<span class="comment">/**
 * Clears the bits with specified bit mask and returns the new value.
 * <span class="attrib">@param</span> {Integer} The value.
 * <span class="attrib">@param</span> {Integer} The bit mask.
 *
 * <span class="attrib">@return</span> {Integer} The new value.
 */</span>
COMMONS.BITTOOLS.clearBit = <span class="reserved">function</span>(aValue, aMask)
{
	<span class="reserved">return</span> aValue &amp; ~aMask;
};

<span class="comment">/**
 * Toggles the bits with specified bit mask and returns the new value.
 * <span class="attrib">@param</span> {Integer} The value.
 * <span class="attrib">@param</span> {Integer} The bit mask.
 *
 * <span class="attrib">@return</span> {Integer} The new value.
 */</span>
COMMONS.BITTOOLS.toggleBit = <span class="reserved">function</span>(aValue, aMask)
{
	var check = <span class="reserved">this</span>.isChecked(aValue, aMask);
	<span class="reserved">return</span> check ? <span class="reserved">this</span>.clearBit(aValue, aMask) : <span class="reserved">this</span>.setBit(aValue, aMask);
};

</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">
<p class='footer'>Copyright (c) 2007, <a href='http://soft-amis.com'>SoftAMIS<a></p>
</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Tue Apr  3 19:01:58 2007</div>
</body>
</html>
